********************************************************************************
**** Non-Party Government: Bipartisan Lawmaking and Party Power in Congress ****
** James M. Curry & Frances E. Lee **
*************************************

** Commands to replicate tables and figures **

*************************
*** FIGURES 1, 2, & 3 ***
*************************
** pre-formatted **

use "PassageVotes-ByCong.dta", clear

**** FIGURE 1 ****
** House minority party in favor
line Hpct_min LMh_minpctinfavor cong, ///
	title("House of Representatives") ytitle("% Minority Party in Favor") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") yline(.5) ///
	xscale(range(93 114)) xlabel(93 "93rd (73-74)" 94 "94th (75-76)" 95 "95th (77-78)" 96 "96th (79-80)" 97 "97th (81-82)" 98 "98th (83-84)" 99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "All Laws" 2 "Landmark Laws"))
** Senate minority party in favor
line Spct_min LMs_minpctinfavor cong, ///
	title("Senate") ytitle("% Minority Party in Favor") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") yline(.5) ///
	xscale(range(93 114)) xlabel(93 "93rd (73-74)" 94 "94th (75-76)" 95 "95th (77-78)" 96 "96th (79-80)" 97 "97th (81-82)" 98 "98th (83-84)" 99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "All Laws" 2 "Landmark Laws"))
	
**** FIGURE 2 ****
** House minority party rolls
line Hminroll50 LMh_minroll50 cong, ///
	title("House of Representatives") ytitle("% Minority Party Rolled") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") yline(.5) ///
	xscale(range(93 114)) xlabel(93 "93rd (73-74)" 94 "94th (75-76)" 95 "95th (77-78)" 96 "96th (79-80)" 97 "97th (81-82)" 98 "98th (83-84)" 99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "All Laws" 2 "Landmark Laws"))
** Senate minority party rolls
line Sminroll50 LMs_minroll50 cong, ///
	title("Senate") ytitle("% Minority Party Rolled") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") yline(.5) ///
	xscale(range(93 114)) xlabel(93 "93rd (73-74)" 94 "94th (75-76)" 95 "95th (77-78)" 96 "96th (79-80)" 97 "97th (81-82)" 98 "98th (83-84)" 99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "All Laws" 2 "Landmark Laws"))

**** FIGURE 3 ****
** House minority needed
line Hminneeded LMh_minneeded cong, ///
	title("House of Representatives") ytitle("% Minority Votes needed for Passage") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") yline(.5) ///
	xscale(range(93 114)) xlabel(93 "93rd (73-74)" 94 "94th (75-76)" 95 "95th (77-78)" 96 "96th (79-80)" 97 "97th (81-82)" 98 "98th (83-84)" 99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "All Laws" 2 "Landmark Laws"))
** Senate minority needed
line Sminneeded LMs_minneeded cong, ///
	title("Senate") ytitle("% Minority Votes needed for Passage") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") yline(.5) ///
	xscale(range(93 114)) xlabel(93 "93rd (73-74)" 94 "94th (75-76)" 95 "95th (77-78)" 96 "96th (79-80)" 97 "97th (81-82)" 98 "98th (83-84)" 99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "All Laws" 2 "Landmark Laws"))


***************
*** TABLE 1 ***
***************
** House Regression Analyses **

use "AllLaws-House-1973-2016.dta", clear

* Percent Minority Party Support
eststo: reg pct_minority housepolar house_majority_unity house_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
eststo: reg pct_minority housepolar c.house_majority_unity##c.house_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 

* Minority Party Rolls
eststo: logit minroll50 housepolar house_majority_unity house_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
eststo: logit minroll50 housepolar c.house_majority_unity##c.house_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 

* Minority Party Votes Needed
eststo: logit minorityneeded housepolar house_majority_unity house_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
eststo: logit minorityneeded housepolar c.house_majority_unity##c.house_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 


***************
*** TABLE 2 ***
***************
** Senate Regression Analyses **

use "AllLaws-Senate-1973-2016.dta", clear

* Percent Minority Party Support
eststo: reg minpctinfavor senatepolar senate_majority_unity senate_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
eststo: reg minpctinfavor senatepolar c.senate_majority_unity##c.senate_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 

* Minority Party Rolls
eststo: logit minroll50 senatepolar senate_majority_unity senate_maj_seat dividedgov distchambermed i.major, cluster(cong)
eststo: logit minroll50 senatepolar c.senate_majority_unity##c.senate_maj_seat dividedgov distchambermed i.major, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 

* Minority Party Votes Needed
eststo: logit minorityneeded senatepolar senate_majority_unity senate_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
eststo: logit minorityneeded senatepolar c.senate_majority_unity##c.senate_maj_seat dividedgov i.majority##c.distchambermed i.major, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 


*********************
*** FIGURES 4 & 5 ***
*********************

use "MajorityAgendaPriorities-1985-2016.dta", clear

** FIGURE 4 **
* pre-formatted
egen all_mean = mean(all_outcome), by(congress)
egen some_mean = mean(some_outcome), by(congress)
egen none_mean = mean(none_outcome), by(congress)

twoway connected all_mean some_mean none_mean congress, /// 
	xtitle("") ytitle("% of all priority agenda items") /// 
	yscale(range(0 .8)) ylabel(0 "0%" .2 "20%" .4 "40%" .6 "60%" .8 "80%") ///
	xscale(range(99 114)) xlabel(99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(1) order(1 "Most" 2 "Some" 3 "None"))
	
** FIGURE 5 **
* pre-formatted
egen overopp_mean = mean(partisanoutcome), by(congress)
egen bipart_mean = mean(bipartoutcome), by(congress)
egen minlead_mean = mean(withminleadsupport), by(congress)

twoway connected overopp_mean bipart_mean minlead_mean congress, ///
	xtitle("") ytitle("% of all priority agenda successes") ///
	yscale(range(0 1)) ylabel(0 "0%" .25 "25%" .5 "50%" .75 "75%" 1 "100%") ///
	xscale(range(99 114)) xlabel(99 "99th (85-86)" 100 "100th (87-88)" 101 "101st (89-90)" 102 "102nd (91-92)" 103 "103rd (93-94)" 104 "104th (95-96)" 105 "105th (97-98)" 106 "106th (99-00)" 107 "107th (01-02)" 108 "108th (03-04)" 109 "109th (05-06)" 110 "110th (07-08)" 111 "111th (09-10)" 112 "112th (11-12)" 113 "113th (13-14)" 114 "114th (15-16)",  angle(vertical)) ///
	legend(position(6) rows(3) order(1 "Over opposition of a majority of minority party in both chamber " 2 "With support of a majority of minority party in either House or Senate" 3 "With support of minority party leaders in either House or Senate"))

	

**********************************
*** APPENDIX TABLES & ANALYSES ***
**********************************

*****************
*** TABLE A-1 ***
*****************

use "MayhewLandmarkLaws-1973-2016.dta", clear

* Percent Minority Party Support
eststo: reg h_minpctinfavor housepolar house_majority_unity house_maj_seat dividedgov, cluster(cong)
eststo: reg h_minpctinfavor housepolar c.house_majority_unity##c.house_maj_seat dividedgov, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 
* Percent Minority Party Support
eststo: logit h_minroll50 housepolar house_majority_unity house_maj_seat dividedgov, cluster(cong)
eststo: logit h_minroll50 housepolar c.house_majority_unity##c.house_maj_seat dividedgov, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 
* Percent Minority Party Support
eststo: logit h_minneeded housepolar house_majority_unity house_maj_seat dividedgov, cluster(cong)
eststo: logit h_minneeded housepolar c.house_majority_unity##c.house_maj_seat dividedgov, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 


*****************
*** TABLE A-2 ***
*****************

use "MayhewLandmarkLaws-1973-2016.dta", clear

* Percent Minority Party Support
eststo: reg s_minpctinfavor senatepolar senate_majority_unity senate_maj_seat dividedgov, cluster(cong)
eststo: reg s_minpctinfavor senatepolar c.senate_majority_unity##c.senate_maj_seat dividedgov, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 
* Percent Minority Party Support
eststo: logit s_minroll50 senatepolar senate_majority_unity senate_maj_seat dividedgov, cluster(cong)
eststo: logit s_minroll50 senatepolar c.senate_majority_unity##c.senate_maj_seat dividedgov, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 
* Percent Minority Party Support
eststo: logit s_minneeded senatepolar senate_majority_unity senate_maj_seat dividedgov, cluster(cong)
eststo: logit s_minneeded senatepolar c.senate_majority_unity##c.senate_maj_seat dividedgov, cluster(cong)
esttab, se star(* 0.05 ** 0.01)
eststo clear 


*****************
*** TABLE A-4 ***
*****************

use "MajorityAgendaPriorities-1985-2016.dta", clear

eststo: mlogit outcome house_polar c.house_majority_unity##c.house_maj_seat senate_polar c.senate_majority_unity##c.senate_maj_seats divided_gov i.pap_major, cluster(congress) baseoutcome(3)
esttab, se star(* 0.05 ** 0.01)
eststo clear 


*****************
*** TABLE A-5 ***
*****************

use "MajorityAgendaPriorities-1985-2016.dta", clear

eststo: logit partisanoutcome house_polar c.house_majority_unity##c.house_maj_seat senate_polar c.senate_majority_unity##c.senate_maj_seats divided_gov, cluster(congress)
esttab, se star(* 0.05 ** 0.01)
eststo clear 

